<template>
  <div>
    <transition name="slide-up">
      <div v-show="menuVisible" :class="{'hide-box-shadow' : !menuVisible || settingVisible >= 0}" class="menu-wrapper">
        <div class="icon-wrapper">
          <span class="icon-menu" @click="showSetting(3)" />
        </div>
        <div class="icon-wrapper">
          <span class="icon-progress" @click="showSetting(2)" />
        </div>
        <div class="icon-wrapper">
          <span class="icon-bright" @click="showSetting(1)" />
        </div>
        <div class="icon-wrapper">
          <span class="icon-A" @click="showSetting(0)" />
        </div>
      </div>
    </transition>
    <ebook-setting-font />
    <ebook-setting-font-popup />
    <ebook-setting-theme />
    <ebook-setting-progress />
  </div>
</template>

<script>
import EbookSettingFont from './EbookSettingFont.vue'
import EbookSettingFontPopup from './EbookSettingFontPopup.vue'
import { ebookMixin } from '../../mixin/mixin'
import EbookSettingTheme from './EbookSettingTheme.vue'
import EbookSettingProgress from './EbookSettingProgress.vue'
export default {
  components: {
    EbookSettingFont,
    EbookSettingFontPopup,
    EbookSettingTheme,
    EbookSettingProgress
  },
  mixins: [ebookMixin],
  methods: {
    showSetting(index) {
      this.$store.dispatch('book/setSettingVisible', index)
    }
  }
}
</script>

<style lang="scss" scoped>
@import '../../style/index';
.menu-wrapper {
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 102;
    display: flex;
    width: 100%;
    height: px2rem(48);
    background: white;
    box-shadow: 0 px2rem(-8) px2rem(8) rgba(0, 0, 0, .15);
    font-size: px2rem(20);
    &.hide-box-shadow {
      box-shadow: none;
    }
    .icon-wrapper {
      flex: 1;
      @include center;
      .icon-progress, .icon-bright {
        font-size: px2rem(22);
      }
    }
  }
</style>
